package com.telecom.cms.dao;


import java.io.*;
import java.sql.*;
import java.util.ArrayList;
import java.util.HashMap;
import com.telecom.cms.util.*;


public class manDao 
{
	
public static int deleteUser(String user_id)
    {
    	String sql = "delete from PD_MARTDATA_A.APP_CAMP_USER_bak where emp_id ='"+ user_id +"'";
    	int flag;
System.out.println(sql);
    	
    	 try
			 {
               DaoImp daoimp = new DaoImp();
               return daoimp.delete(sql);
               
             
			 }
			catch(Exception e)
			{
				e.printStackTrace();
			}
			return 0;
			
    	
  }
  
  public static int passReset(String user_id)
    {
    	String sql = "update   PD_MARTDATA_A.APP_CAMP_USER_bak set pass = '123456' where emp_id ='"+ user_id +"'";
    	int flag;
      System.out.println(sql);
    	
    	 try
			 {
               DaoImp daoimp = new DaoImp();
               return daoimp.update(sql);
               
             
			 }
			catch(Exception e)
			{
				e.printStackTrace();
			}
			return 0;
			
    	
  }
  
    public static int insertUser(String userName,String emp_id,String src_emp_id,String phone)
    {
    	String sql = "insert into   PD_MARTDATA_A.APP_CAMP_USER_bak(SRC_EMP_Id,"+ 
										" EMP_Id,"+
										" EMP_NAME,"+
										" PHONE) values('"+src_emp_id+"','"+emp_id+"','"+userName+"','"+phone+"')";

    	int flag;
      System.out.println(sql);
    	
    	 try
			 {
               DaoImp daoimp = new DaoImp();
               return daoimp.insert(sql);
               
             
			 }
			catch(Exception e)
			{
				e.printStackTrace();
			}
			return 0;
			
    	
  }
  
   public static int updateUser(String userName,String phone,String emp_id)
    {
    	String sql =
"	update  PD_MARTDATA_A.APP_CAMP_USER_bak  "+
"	set emp_name = '"+userName+"',phone = '"+phone+"'"+
"	where emp_id = '"+    emp_id           +"'   ";

    	int flag;
      System.out.println(sql);
    	
    	 try
			 {
               DaoImp daoimp = new DaoImp();
               return daoimp.update(sql);
               
             
			 }
			catch(Exception e)
			{
				e.printStackTrace();
			}
			return 0;
			
    	
  }

 
    
}